﻿using System.Collections.Generic;
using System.Text;
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
using System.IO;

namespace Ramparts
{
    class MoveOnBearingState : I_State
    {

        AnimatedSprite animation;
        SpriteBatch spriteBatch;
        GameComponent component;
        public bool stateFinished;

        public MoveOnBearingState(AnimatedSprite animation, GameComponent component)
        {
            this.animation = animation;
            this.animation.loop = true;
            this.spriteBatch = component.sceneManager.rampart.spriteBatch;
            this.component = component;
        }

        #region I_State Members

        public void begin()
        {
            animation.playing = true;
        }

        public void stop()
        {
            // Do Nothing
        }


        public void update(GameTime gameTime)
        {
            // component.position.X = component.position.X + (component.speed * (float)Math.Cos(component.bearing));
            // component.position.Y = component.position.Y + (component.speed * (float)Math.Sin(component.bearing));
            animation.Update(gameTime);
        }

        public void draw()
        {
            // TODO ROTATE TO CURRENT BEARING
            animation.Draw(component.position);
        }

        public void processMouseEvents()
        {
            // Do Nothing
        }

        public void processKeyboardEvents()
        {
            // Do Nothing
        }

        #endregion
    }
}
